<div ng-include="sys_html('layout/_header')"></div>
<link href="../addons/jy_weishop/resource/pc/css/home_goods.css?v=13" rel="stylesheet" type="text/css">
<script type="text/javascript"  src="../addons/jy_weishop/resource/pc/js/cloudzoom.js"></script>
<style type="text/css">
    .ncs-goods-picture .levelB, .ncs-goods-picture .levelC {
        cursor: url("../addons/jy_weishop/resource/pc/images/shop/zoom.cur"), pointer;
    }
    .ncs-goods-picture .levelD {
        cursor: url("../addons/jy_weishop/resource/pc/images/shop/hand.cur"), move \9;
    }
    .nch-sidebar-all-viewed {
        display: block;        height: 20px;        text-align: center;        padding: 9px 0;
    }
.option-picker .option-picker-cell.option .btn.btn-select{
    color: red;
    height:1.25rem;
    line-height: 1.25rem;
    background: #FFE8E8;
    font-size:0.6rem;
	border: 1px solid red;
}
.cloudzoom-lens {background-color:rgba(255,255,255,0.2);}
.ncs-goods-summary dl dt, .ncs-goods-summary dl dd {
    font-size: 16px;
    line-height: 24px;
}
.ncs-goods-summary .name strong {
    font-weight: normal;
    font-size: 14px;
}
</style>
<div class="wrapper pr fui-page">
    <input type="hidden" id="lockcompare" value="unlock"/>
    <div class="ncs-detail ownshop">
        <!-- S 商品图片 -->
        <div id="ncs-goods-picture" class="ncs-goods-picture">
            <div class="gallery_wrap">
                <div class="gallery">
				<img title="鼠标向上或向下滚动，能放大或缩小图片哦~" ng-src="{{tomedia(pagedata.goods.image) || '../core/resource/images/nopic.jpg'}}" class="cloudzoom"></div>
            </div>
            <div class="controller_wrap">
                <div class="controller">
                    <ul>
                        <li ng-repeat="image in pagedata.images" ng-class="{'current':pagedata.nowimage==$index}">
							<a href="javascript:;" ng-click="pagedata.setnowimage($index);">
								<img title="鼠标滚轮向上或向下滚动，能放大或缩小图片哦~" class='cloudzoom-gallery' ng-src="{{tomedia(image)}}" width="60" height="60">
							</a>
						</li>
                    </ul>
                </div>
            </div>
			 <!-- E 商品图片及收藏分享 -->
			<div class="ncs-handle">
				<!-- S 收藏 -->
				<a class="nav-item favorite-item active">
					<i href="javascript:;" ng-click="pagedata.setlike();toogle(pagedata,'islike')" ng-class="{'icon jinyunicon':1,'icon-follow':pagedata.islike !=1,'icon-xiai':pagedata.islike >0}"></i>
					<span class="label" style="font-size: 16px;line-height: 16px;">关注</span>
				</a>
			</div>
        </div>
        <!-- S 商品基本信息 -->
        <div class="ncs-goods-summary">
            <div class="name" style="padding-bottom:0">
                <h1>{{pagedata.goods.title}}</h1>
                <strong>{{pagedata.goods.subtitle}}</strong></div>
            <div class="ncs-meta">
				<!-- S 商品发布价格 -->
                <dl>
                    <dt>商&nbsp;城&nbsp;价：</dt>
                    <dd class="price">
                        <strong>&yen;{{pagedata.goods.price}}</strong>
                    </dd>
                </dl>
                <!-- S 商品参考价格 -->
                <dl>
                    <dt>市&nbsp;场&nbsp;价：</dt>
                    <dd class="cost-price"><strong>&yen;{{pagedata.goods.originalprice}}</strong></dd>
                </dl>
                <!-- E 商品参考价格 -->
                <dl class="rate">
                    <dt>商品评分：</dt>
                    <!-- S 描述相符评分 -->
                    <dd><span class="raty" data-score="5"></span><a href="#ncGoodsRate">共有{{pagedata.commons.count.all || 0}}条评价</a></dd>
                    <!-- E 描述相符评分 -->
                </dl>
                <!-- E 商品发布价格 -->
                <div class="ncs-goods-code" id="qrcode-goodsurl" ng-init="tool.qr(pagedata.goodsurl,'qrcode-goodsurl',100)">
				</div>
            </div>
                <!-- S 促销 -->
                <div ng-if="pagedata.goods.isdiscount && pagedata.goods.isdiscount_time>=pagedata.time" class="ncs-sale">
                    <dl>
                        <dt>促&#12288;&#12288;销：</dt>
                        <dd class="promotion-info">
                            <span class="sale-name">{{ifelse(empty(pagedata.goods.isdiscount_title),'促销',pagedata.goods.isdiscount_title)}}</span>
                            <!-- S 限时折扣 -->
                        <span class="sale-rule w400">直降<em>&yen;41.00</em>
                        最低2件起，挥泪大甩卖                        </span>                            <!-- E 限时折扣  -->                            <!-- S 团购-->                            <!-- E 团购 -->                            <!--S 满就送 -->                            <!--E 满就送 -->
                        </dd>                    </dl>
                    <!-- S 赠品 -->
                    <!-- E 赠品 -->
                </div>
                <!-- E 促销 -->
            <!--送达时间 begin  -->
            <!--送达时间 end  -->
            <div ng-if="!empty(pagedata.hasServices)" class="ncs-key" style="padding: 0 30px">
                    <i ng-if="pagedata.goods.cash==2" class='icon icon-yuding text-danger '></i> {{ifelse(pagedata.goods.cash==2,'货到付款','')}}
                    <i ng-if="pagedata.goods.quality" class='icon icon-yuding text-danger '></i> {{ifelse(pagedata.goods.quality,'正品保证','')}}                    <i ng-if="pagedata.goods.repair" class='icon icon-yuding text-danger '></i> {{ifelse(pagedata.goods.repair,'保修','')}}                    <i ng-if="pagedata.goods.invoice" class='icon icon-yuding text-danger '></i> {{ifelse(pagedata.goods.invoice,'发票','')}}                    <i ng-if="pagedata.goods.seven" class='icon icon-yuding text-danger '></i> {{ifelse(pagedata.goods.seven,'7天退换','')}}
            </div>
            <div class="ncs-logistics">
                <dl id="ncs-freight" class="ncs-freight">
                    <dd class="ncs-freight_box">                        <div id="ncs-freight-selector" class="ncs-freight-select">
                            <div id="ncs-freight-prompt" style="padding-left: 30px"><strong>有货</strong><span ng-if="pagedata.goods.isshowsales=='1' && pagedata.options.stock">（库存 <span class='total'>{{pagedata.options.stock}}</span> {{pagedata.goods.unit || '件'}}）</span>
                                        <span ng-if="pagedata.goods.dispatchprice_isarray==1 && pagedata.goods.type==1">快递: {{pagedata.goods.dispatchprice.min}} ~ {{pagedata.goods.dispatchprice.max}}</span>
                                        <span ng-if="pagedata.goods.dispatchprice_isarray!=1 && pagedata.goods.type==1">快递: {{ifelse(pagedata.goods.dispatchprice == 0,'包邮',pagedata.goods.dispatchprice)}}</span>
						   </div>
						</div>
                    </dd>
                </dl>
                <!-- S 物流与运费新布局展示  -->
            </div>
			<div class="option-picker" ng-if="pagedata.specs_list.length>0" style="padding:10px;padding-left:30px;width:auto">
				<div class="option-picker-inner" style="border-top: 0 solid #eee;">
					<div class="option-picker-options modal-swiper-y">
						<div ng-repeat="(k,spec) in pagedata.specs_list" class="option-picker-cell option spec">
						<div class="title" style="font-size:16px;padding-top:5px;padding-left:5px">{{spec.title}}</div>
						<div class="select" style="border: solid 0 #CCC;">
							 <a ng-repeat="item in spec.items" href="javascript:;" ng-click="pagedata.post.specid[k]=item.id;pagedata.get_optionsid();" ng-class="{'btn btn-default btn-sm nav spec-item':1,'btn-select':pagedata.post.specid[k]==item.id}"> {{item.title}} </a>
						</div>
						</div>
					</div>
				</div>
			</div>
            <!-- S 购买数量及库存 -->                <div ng-if="pagedata.goods.canbuy" class="ncs-buy">
                    <div class="ncs-figure-input">                        <input ng-model="pagedata.post.num" name="" type="tel" id="quantity" value="1" size="3" maxlength="6" class="input-text num">                        <a href="javascript:void(0)" ng-click="pagedata.plus()" class="increase plus">&nbsp;</a>                        <a  href="javascript:void(0)" ng-click="pagedata.minus()" class="decrease minus">&nbsp;</a>
                    </div>
                    <div class="ncs-point" style="display: none;"><i></i>                        <!-- S 库存 -->                        <span>您选择的商品库存<strong nctype="goods_stock">55</strong>件
                        <!-- E 库存 -->
                    </div>
                    <!-- S 提示已选规格及库存不足无法购买 -->
                    <!-- E 提示已选规格及库存不足无法购买 -->
                    <div class="ncs-btn">
                        <!-- v3-b10 限制购买-->
                            <!-- 加入购物车-->
                            <a ng-if="pagedata.canAddCart" href="javascript:" ng-click="post({goodsid:pagedata.goods.id,num:pagedata.post.num},'addtocart')"  nctype="addcart_submit" class="addcart cartbtn" title="添加购物车"><i class="icon-shopping-cart"></i>添加购物车</a>
							<!-- 立即购买-->
							<a nctype="buynow_submit" class="buynow" href="javascript:" ng-click="access_json('jy_weishop/order.create//goodsid='+pagedata.post.goodsid+'&num='+pagedata.post.num+'&optionsid='+pagedata.options.id)" title="立即购买">立即购买</a>
                        <!-- v3-b10 end-->
                        <!-- S 加入购物车弹出提示框 -->
                        <div class="ncs-cart-popup">
                            <dl>                                <dt>成功添加到购物车<a title="关闭" onClick="$('.ncs-cart-popup').css({'display':'none'});">X</a>                                </dt>                                <dd>购物车共有 <strong id="bold_num"></strong> 种商品 总金额为：<em id="bold_mly" class="saleP"></em>                                </dd>                                <dd class="btns">                                    <a href="javascript:void(0);" class="ncs-btn-mini ncs-btn-green"                                                    onclick="location.href='/index.php?act=cart'">查看购物车</a>                                    <a href="javascript:void(0);" class="ncs-btn-mini" value=""                                       onclick="$('.ncs-cart-popup').css({'display':'none'});">继续购物</a>                                </dd>                            </dl>                        </div>                        <!-- E 加入购物车弹出提示框 -->                    </div>                    <!-- E 购买按钮 -->                </div>         
                <div  ng-if="!pagedata.goods.canbuy" class="fui-cell-group fui-cell-click">                    <div class="fui-cell">                        <div ng-if="pagedata.goods.userbuy==0" class="fui-cell-text"> 您已经超出最大{{pagedata.goods.usermaxbuy}}件购买量  </div>                        <div ng-if="pagedata.goods.userbuy!=0 && pagedata.goods.levelbuy==0" class="fui-cell-text"> 您当前会员等级没有购买权限  </div>                        <div ng-if="pagedata.goods.userbuy!=0 && pagedata.goods.levelbuy!=0 && pagedata.goods.groupbuy==0" class="fui-cell-text"> 您所在的用户组没有购买权限  </div>                        <div ng-if="pagedata.goods.userbuy!=0 && pagedata.goods.levelbuy!=0 && pagedata.goods.groupbuy!=0 && pagedata.goods.timebuy ==-1" class="fui-cell-text"> 未到开始抢购时间! </div>                        <div ng-if="pagedata.goods.userbuy!=0 && pagedata.goods.levelbuy!=0 && pagedata.goods.groupbuy!=0 && pagedata.goods.timebuy !=-1 && pagedata.goods.timebuy ==1" class="fui-cell-text"> 抢购时间已经结束! </div>                        <div ng-if="pagedata.goods.userbuy!=0 && pagedata.goods.levelbuy!=0 && pagedata.goods.groupbuy!=0 && pagedata.goods.timebuy !=-1 && pagedata.goods.timebuy !=1 && pagedata.goods.total <=0" class="fui-cell-text red" style="padding:20px;font-size:18px">商品已经售罄! </div>
                    </div>
                </div>
            <!-- E 购买数量及库存 -->
            <!--E 商品信息 -->        </div>
        <!--S 店铺信息-->        <div style="position: absolute; z-index: 2; top: -1px; right: -1px;">            <!--店铺基本信息 S-->            <div class="ncs-info">                <div class="title">                    <h4>{{pagedata.shop.name}}</h4>
                </div>
                <div class="content">
                    <dl class="messenger">
                        <dt>联系方式：</dt>
                        <dd><span member_id="1"></span>
                        </dd>
                    </dl>
                    <!--只有实名认证实体店认证后才显示保障体系 by 9yetech.com -->
                    <!--保证金金额-->
                    <div class="goto"><a >进入商家店铺</a><a
                                href="javascript:collect_store('1','count','store_collect')">收藏店铺<em
                                    nctype="store_collect">0</em></a></div>
                    <div class="shop-other" id="shop-other">
                        <ul>
                            <li class="ncs-info-btn-map"><a href="javascript:void(0)" class="pngFix"><span>店铺地图</span><b></b> <!-- 店铺地图 -->
                                    <div class="ncs-info-map" id="map_container" style="width:208px;height:208px;"></div>
                                </a></li>
                            <li class="ncs-info-btn-qrcode">
								<a href="javascript:void(0)" class="pngFix"><span>店铺二维码</span><b></b>
                                    <p class="ncs-info-qrcode" id="qrcode-shopurl" ng-init="qrcode(pagedata,'shopurl')"></p>
								</a>
							</li>
                        </ul>
                    </div>
                </div>
            </div>
            <!--S 看了又看 -->
            <div class="ncs-lal">
                <div class="title">看了又看</div>
                <div class="content">
                    <ul>
                            <li ng-repeat="g in pagedata.history">
                                <div class="goods-pic">
								<div style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden;">{{g.title}}</div>
								<a title="{{g.goodsinfo.title}}" href="javascript:;" ng-click="access_json('jy_weishop/goods.detail//id='+g.goodsid)">
                                      <img alt="" ng-src="{{tomedia(g.goodsinfo.image)}}" rel="lazy" ng-src="{{tomedia(g.goodsinfo.image)}}" height="50"/>
                                 </a>
								</div>
                                <div class="goods-price" style="margin-top: 15px">￥{{g.goodsinfo.price}}</div>
                            </li>
							<div ng-if="pagedata.historyloading" class='infinite-loading'><span class='fui-preloader'></span><span style="margin-left:1.5rem"> 正在加载...</span></div>

                    </ul>
                </div>
            </div>
            <!--E 看了又看 -- >
           </div>
        <!--E 店铺信息 -->
        </div>
        <div class="clear"></div>
    </div>
    <div id="content" class="ncs-goods-layout expanded">
        <div class="ncs-goods-main" id="main-nav-holder">
            <div class="tabbar pngFix" id="main-nav">
                <div class="ncs-goods-title-nav">
                    <ul id="categorymenu">
                        <li class="current"><a ng-click="pagedata.tabshow='tabGoodsIntro'" href="#">商品详情</a></li>
						<li><a ng-click="pagedata.tabshow='tabGoodsSort'" href="#">商品参数</a></li>
                        <li><a ng-click="pagedata.tabshow='tabGoodsRate'" href="#">商品评价<em>({{pagedata.commentsfen.count.all}})</em></a></li>
                    </ul>
                    <div class="switch-bar"><a href="javascript:void(0)" id="fold">&nbsp;</a></div>
                </div>
            </div>
            <div class="ncs-intro">
                <div class="content bd" style="background:#fff;padding:10px;">
                    <div class="nc-goods-sort" ng-if="pagedata.tabshow=='tabGoodsSort'" id="tabGoodsSort" >
						<div class="fui-cell-group">
							<div ng-repeat="p in pagedata.goods.param" class="fui-cell">
								<div class="fui-cell-label md" >{{p.title}}</div>
								<div class="fui-cell-info overflow md">{{p.value}}</div>
							</div>
                            <div ng-if="!pagedata.goods.param || pagedata.goods.param.length<1" class="fui-cell">
								<div class="fui-cell-info text-align">商品没有参数</div>
							</div>
						</div>
                    </div>
					<div class="ncs-goods-info-content" ng-if="pagedata.tabshow=='tabGoodsIntro'" id="ncGoodsIntro">
							<div class="default" ng-bind-html="trust(pagedata.goods.content)">
							</div>
					</div>
					<div class="ncs-comment" ng-if="pagedata.tabshow=='tabGoodsRate'"  id="tabGoodsRate">
						<div class="ncs-goods-title-bar hd">
							<h4><a href="javascript:void(0);">商品评价</a></h4>
						</div>
						<div class="ncs-goods-info-content bd" id="ncGoodsRate">
							<div class="top">
								<div class="rate">
									<p><strong>{{pagedata.commentsfen.percent || 100}}</strong><sub>%</sub>好评</p>
									<span>共有{{pagedata.commentsfen.count.all}}人参与评分</span></div>
								<div class="percent">
									<dl>
										<dt>好评<em>({{pagedata.commentsfen.percent}}%)</em></dt>
										<dd><i style="width: {{pagedata.commentsfen.percent}}%"></i></dd>
									</dl>
									<dl>
										<dt>中评<em>({{pagedata.commentsfen.normal_percent}}%)</em></dt>
										<dd>
											<i style="width:{{pagedata.commentsfen.normal_percent}}%"></i>
										</dd>
									</dl>
									<dl>
										<dt>差评<em>({{pagedata.commentsfen.bad_percent}}%)
												</em></dt>
										<dd>
											<i style="width:{{pagedata.commentsfen.bad_percent}}%"></i>
										</dd>
									</dl>
								</div>
								<div class="btns"><span>您可对已购商品进行评价</span>
									<p><a href="javascript:;" ng-click="access_json('jy_weishop/order.list/')"
										  class="ncs-btn ncs-btn-red" target="_blank"><i class="icon-comment-alt"></i>评价商品</a>
									</p>
								</div>
							</div>
							<div class="ncs-goods-title-nav">
								<ul id="comment_tab">
									<li data-type="all" ng-click="pagedata.showpj='all'" ng-class="{'current':pagedata.showpj=='all'}"><a href="javascript:void(0);">商品评价({{pagedata.commentsfen.count.all}})</a></li>
									<li data-type="good" ng-click="pagedata.showpj='good'" ng-class="{'current':pagedata.showpj=='good'}"><a href="javascript:void(0);">好评({{pagedata.commentsfen.count.good}})</a></li>
									<li data-type="normal" ng-click="pagedata.showpj='normal'" ng-class="{'current':pagedata.showpj=='normal'}"><a href="javascript:void(0);">中评({{pagedata.commentsfen.count.normal}})</a>
									</li>
									<li data-type="bad" ng-click="pagedata.showpj='bad'" ng-class="{'current':pagedata.showpj=='bad'}"><a href="javascript:void(0);">差评({{pagedata.commentsfen.count.bad}})</a></li>
								</ul>
							</div>
							<!-- 商品评价内容部分 -->
							<div id="goodscomments" class="ncs-commend-main">
								<div ng-include="sys_html('goods/comment_list')"></div>
							</div>
						</div>
					</div>
                </div>
            </div>
            <div class="ncg-salelog">
            </div>
            <div class="ncs-recommend">
            </div>
        </div>
        <div class="ncs-sidebar">
            <div class="ncs-sidebar-container ncs-top-bar">
                <div class="title">
                    <h4>商品排行</h4>
                </div>
                <div class="content">
                    <div id="hot_sales_list" class="ncs-top-panel">
                        <ol>
                                <li ng-repeat="g in pagedata.hot_list">
                                    <dl>
                                        <dt>
                                            <a href="javascript:;" ng-click="access_json('jy_weishop/goods.detail//id='+g.id)">{{g.title}}</a>
                                        </dt>
                                        <dd class="goods-pic">
                                            <a href="javascript:;" ng-click="access_json('jy_weishop/goods.detail//id='+g.id)">
                                            <span class="thumb size40"><i></i>
                                                <img ng-src="{{tomedia(g.image)}}" onload="javascript:DrawImage(this,40,40);" height="40" width="40"></span>
                                            </a>
                                            <p>
                                            <span class="thumb size100"><i></i>
                                                <img ng-src="{{tomedia(g.image)}}" onload="javascript:DrawImage(this,100,100);" height="100" width="100" title="{{g.title}}">
                                            </span>
                                            </p>
                                        </dd>
                                        <dd class="price pngFix">{{g.price}}</dd>
                                        <dd class="selled pngFix">售出：<strong>{{g.salenum || 0}}</strong>笔</dd>
                                    </dl>
                                </li>
                        </ol>
						<div ng-if="pagedata.hotloading" class='infinite-loading'><span class='fui-preloader'></span><span style="margin-left:1.5rem"> 正在加载...</span></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div></div>
<script type="text/javascript">
scope.pagedata.historyloading=true
scope.pagedata.gethistorygoods=function(item){
	scope.get('jy_weishop/get_data/gethistorygoods/',function(res){
				scope.pagedata.history=res.list
				scope.pagedata.historyloading=false
				scope.$evalAsync();
	});
}
scope.pagedata.gethistorygoods();
scope.pagedata.hotloading=true
scope.pagedata.gethot_goods=function(item){
	scope.get('jy_weishop/get_data/gethot_goods/',function(res){
				scope.pagedata.hot_list=res.list
				scope.pagedata.hotloading=false
				scope.$evalAsync();
	});
}
scope.pagedata.gethot_goods();
scope.pagedata.tabshow='tabGoodsIntro'
scope.pagedata.showpj='all'
scope.pagedata.nowimage=0
//切换图片
scope.pagedata.setnowimage=function(index){
	scope.pagedata.nowimage=index
	scope.pagedata.goods.image=scope.pagedata.goods.images[index]
	scope.$evalAsync();
}
setTimeout(function() {
	CloudZoom.quickStart();
},500);
$(function () {
        // 放大镜效果 产品图片
        
        // 商品内容介绍Tab样式切换控制
        $('#categorymenu').find("li").click(function () {
            $('#categorymenu').find("li").removeClass('current');
            $(this).addClass('current');
        });
        // 点击地图隐藏其他以及其标题栏
        $('#tabStoreMap').click(function () {
            $('.bd').css('display', 'none');
            $('.hd').css('display', 'none');        });
        // 点击成交隐藏其他以及其标题
        $('#tabGoodsTraded').click(function () {
            $('.bd').css('display', 'none');
            $('#ncGoodsTraded').css('display', '');
            $('.hd').css('display', 'none');
        });
        //评价列表
        $('#comment_tab').on('click', 'li', function () {
            $('#comment_tab li').removeClass('current');
            $(this).addClass('current');
            load_comments($(this).attr('data-type'));        });});
</script>
<script type="text/javascript">
scope.pagedata.tj=function(){
	var jsCheckObject={
		'appid':jssdkconfig.appId,
		'timestamp':jssdkconfig.timestamp,
		'noncestr':jssdkconfig.noncestr,
		'signature':jssdkconfig.signature,
		'url':window.location.href
		};
	if(scope.pagedata.goods.status==0){
		var status =2;
	}else if(scope.pagedata.goods.status==2){
		var status =3;
	}else{
		var status =1;
	}
	var sku={
		'sku_id':scope.pagedata.goods.id, 
		'price':(scope.pagedata.goods.price)*100,
		'original_price':(scope.pagedata.goods.originalprice)*100,
		'status':status
	}
	var productObject={
		'item_code':scope.pagedata.goods.id,
		'title':scope.pagedata.goods.title,
		'desc':scope.pagedata.goods.desc,
		'category_list':{"category_id": 4342,"category_name": "运动裤"}, //类目列表
		'image_list':scope.pagedata.images,
		'src_h5_path':scope.pagedata.url,
		'sku_list':sku,
		
	};
	var jsCheck='${encodeURIComponent(JSON.stringify(jsCheckObject))}&product=${encodeURIComponent(JSON.stringify(productObject))}';
	wx.openBusinessView({
	  businessType: 'friendGoodsRecommend',
	  queryString: jsCheck,
	  success: function (res) {
	 
	  //{"err_msg":"errmsg","extraData":{}}
	  },
	  fail: function (res){
	   alert('请检查参数配置或者公众号权限');
	  //{"err_msg":"errmsg"}
	  }
	})
}
//减少
scope.pagedata.minus=function(){
	if(scope.pagedata.post.num <=1){
		return false;
	}
	scope.pagedata.post.num--;
	scope.$evalAsync();
}
//增加
scope.pagedata.plus=function(){
	scope.pagedata.post.num++;
	scope.$evalAsync();
}
//选择
scope.pagedata.get_optionsid=function(){
	var specid = scope.pagedata.post.specid;
		specid = specid.join('_');
	var params={
		data:{'specid':specid},
		op:'get_optionsid',
		callback:function(res){
			scope.pagedata.post.optionsid=res.options.id;
			scope.pagedata.options=res.options;
			scope.pagedata.goods.price=res.options.price;
			scope.pagedata.goods.originalprice=res.options.productprice;
			scope.pagedata.selespename=res.selespename;
			scope.$evalAsync();
		}
	};
	scope.post_json(params);
}
scope.pagedata.add_address=function(){
	scope.pagedata.address.res=1
	scope.post_json('core/member.address/post/',scope.pagedata.address,function(res){
			scope.pagedata.post.addressid =res;
			$('#modal_address').modal('hide');
			scope.$evalAsync();
	});
}
//选择地址
scope.pagedata.change_address=function(id){
	var params={
		data:{'addressid':id},
		op:'change_address',
		callback:function(res){
		//console.log(res);
			scope.pagedata.post.addressid=res.address.id;
			scope.pagedata.address=res.address;
			scope.$evalAsync();
		}
	};
	scope.post_json(params);
}
//获取关注
scope.pagedata.setlike=function(){
	var params={
		op:'like',
		callback:function(res){
		}
	};
	scope.post_json(params);
}
//if(scope.pagedata.goods.type==3 || (scope.pagedata.goods.type==0 && scope.pagedata.goods.isverify==1)){
	// 百度地图API功能
	window.scope.location(function(re){
		scope.pagedata.getstores(re.lat_lng);
	});
	scope.pagedata.post.storeid =0;
	scope.pagedata.getstores=function(lat_lng){
		var id=scope.pagedata.goods.id;
		scope.post_json('/get_data/getstores/',{'lat_lng':lat_lng,'id':id},function(res){
				scope.pagedata.stores =res.stores
				scope.pagedata.stores_count =res.stores_count
				scope.pagedata.post.storeid = res.stores[0].id;
				scope.pagedata.selectstore = res.stores[0];
				scope.$evalAsync();
		});
	}
//}
scope.pagedata.showstoreitem=function(){
	$('#showstoreitem').modal();
}
</script><div ng-include="sys_html('layout/_footer')"></div>